package order.infrastructure.repository;

import order.domain.model.Address;
import order.domain.repository.AddressRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class AddressRepositoryImpl implements AddressRepository {

    @Autowired
    private JpaAddressRepository jpaAddressRepository;

    @Override
    public void save(Address address) {
        jpaAddressRepository.save(address);
    }

    @Override
    public Address findByOrderId(Long orderId) {
        return jpaAddressRepository.findByOrderOrderId(orderId);
    }
}